<div class="right">
	<div id="bread-nav" class="fn-clear">
		<ul>
			<li><a href="admin/home">后台首页</a></li>
			<li><a>管理员管理</a></li>
		</ul>
	</div>
	<div id="content" class="text-darkgrey">
		<h2>管理员管理</h2>
		<div class="add">
			<a href="admin/home/register">添加新管理员</a>
		</div>
		<?php if ($num > 0) : ?>
		<table>
			<tr>
			<td class="id text-red center">编号</td>
			<td class="title text-red center">管理员</td>
			<td class="time text-red center">创建时间</td>
			<td class="author text-red center">设置管理员权限</td>
			<td class="delete text-red center">删除</td>
			</tr>
			<?php foreach ( $list as $row ) : ?>
				<tr>
				<td class="id center"><?=$row ['id']?></td>
				<td class="title center"><?=$row ['username']?></td>
				<td class="time center"><?=date ( 'Y-m-d H:i:s', strtotime ( $row ['creatTime'] ) )?></td>
				<td class="author center">
					<input type="button" onclick="deal(<?=$row ['id']?>,0)" value="设置为管理权限" class="padding"  <?php if($row['authority']=='0'):?>disabled<?php endif;?>/>
					<input type="button" onclick="deal(<?=$row ['id']?>,1)" value="设置为编辑权限" class="padding" <?php if($row['authority']=='1'):?>disabled<?php endif;?>/>
					<input type="button" onclick="deal(<?=$row ['id']?>,2)" value="设置为查看权限" class="padding" <?php if($row['authority']=='2'):?>disabled<?php endif;?>/>
				</td>
				<td class="delete center"><input type="button" onclick="dele(<?=$row ['id']?>)" value="删除" class="padding" /></td>
				</tr>
			<?php endforeach;?>
		</table>
		<div id="page-nav" class="fn-clear"><?php echo $this->pagination->create_links ();?></div>
		<?php else : ?>
		<p>没有管理员！</p>
		<?php endif;?>
	</div>
	<script type="text/javascript">
	function dele(str) {
		if (confirm("确认删除用户"+str+"？")){
			window.location = getRootPath()+'/admin/home/deleAdmin/'+str;
		}
	}
	function deal(str,au) {
		if(au==0)
			if (confirm("确认将"+str+"号管理员设置成管理权限？")){
				window.location = getRootPath()+'/admin/home/changeAu/'+str+'/'+au;
			}
		if(au==1)
			if (confirm("确认将"+str+"号管理员设置成编辑权限？")){
				window.location = getRootPath()+'/admin/home/changeAu/'+str+'/'+au;
			}
		if(au==2)
			if (confirm("确认将"+str+"号管理员设置成查看权限？")){
				window.location = getRootPath()+'/admin/home/changeAu/'+str+'/'+au;
			}
	}
	</script>
</div>